<div class='span12'>
    <!-- HEADER -->
    <div class='row-fluid'>
        <div class='span12'>
            <div class='page-header'>

                <h1 class="span8">
                    <i class='icon-bullhorn'></i>
                    <span>CATEGORY</span>
                </h1>
                <div class="span4 text-right">
                    <a href="<?= URL::to('category/admin/home/create');?>" class="btn btn-large btn-inverse">Create New</a>
                </div>
            </div>
        </div>
    </div>

    <!-- END OF HEADER -->


    <div class='row-fluid'>
        <div class="span12 box bordered-box blue-border" style="margin-bottom:0;">
            <div class="box-header blue-background">
                <div class="title">Edit Category</div>
                <div class="actions">
                    <a href="#" class="btn box-remove btn-mini btn-link"><i class="icon-remove"></i>
                    </a>
                    <a href="#" class="btn box-collapse btn-mini btn-link"><i></i>
                    </a>
                </div>
            </div>
            <div class="box-content">
                <p><small class="text text-error">Fields denoted with an asterisk (*) are mandatory</small></p>
                <?php if(Session::get('message')) {?>
                <p>
                    <span class="text-danger"> <div class="alert alert-info"><?php echo Session::get('message');?></div></span>
                </p>
                <?php }?>
                <form accept-charset="<?= Settings::get('en','charecter_set');?>" action="<?= URL::current();?>" class="form form-horizontal" method="post">

                    <div class="control-group">
                        <div class="controls">
                            <input type="hidden" name="parent_id" value="<?= $parent_id;?>" >
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" >Parent <span class="text text-error">*</span> </label>
                        <div class="controls">
                            <input class="input-xlarge" type="text" name="parent_name" value="<?= $parent_name;?>" readonly>
                            <span class="text-danger"><?= $errors->has('parent_name') ? 'Invalid' : '' ?></span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" >Category Title <span class="text text-error">*</span></label>
                        <div class="controls">
                            <input class="input-xlarge" placeholder="Category" type="text"  name="name" value="<?= $cat['info']->name;?>">
                            <span class="text text-error"><?= $errors->has('name') ? 'Category Title field is required!' : '' ?></span>
                        </div>
                    </div>
                    
                     <div class="control-group">
                        <label class="control-label" >Category Icon <span class="text text-error">*</span></label>
                        <div class="controls">
                           <select name="category_icon" id="category_icon" class="form-control field">
                           <?php foreach($caticon as $caticon):?>
									<option value="<?= $caticon['name'];?>" <?php if($cat['info']->icon ==$caticon['name']) echo "Selected='selected'"; ?>>
										<?= $caticon['name'];?>
									</option>
									<?php endforeach;?>
                           </select>
                            <span class="text text-error"><?= $errors->has('name') ? 'Category Title field is required!' : '' ?></span>
                        </div>
                    </div>
                    
                    
                    <div class="control-group" hidden>
                        <label class="control-label" >Slug</label>
                        <div class="controls">
                            <input class="input-xlarge" placeholder="url" type="text"  name="slug" value="<?= $cat['info']->slug;?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" >Description</label>
                        <div class="controls">
                            <textarea class="input-xxlarge" placeholder="description"  name="description" rows="3"><?= $cat['info']->description;?></textarea>
                        </div>
                    </div>

                    <hr class="hr-normal">

                    <div class="control-group">
                        <label class="control-label">Meta Title</label>
                        <div class="controls">
                            <input class="input-xlarge" placeholder="Meta Title" type="text"  name="meta_title" value="<?= $cat['info']->meta_title;?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Meta Keyword</label>
                        <div class="controls">
                            <input class="input-xlarge" placeholder="Meta Keyword" type="text"  name="meta_keyword" value="<?= $cat['info']->meta_keyword;?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Meta Description</label>
                        <div class="controls">
                            <textarea class="input-xxlarge" placeholder="Meta Description"  name="meta_description"  rows="3"><?= $cat['info']->meta_description;?></textarea>
                        </div>
                    </div>

                    <div class="form-actions">
                        <input type="hidden" name="catID" id="catID" value="<?= $cat['info']->id ;?>">
                        <button class="btn btn-primary" type="submit"  <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                            <i class="icon-save"></i>
                            Save
                        </button>
                        <button class="btn" type="submit"  <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>Cancel</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


    <!-- END OF CONTENT -->
</div>



